﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CPETwit.Data.Manager;
using CPETwit.Data.Entity;

namespace CPETwit.Web.Business
{
    public class TagBusiness
    {
        readonly TagManager _tagManager = new TagManager();

        public List<Tag> SaveTag(List<string> tags)
        {
            List<Tag> allTags = new List<Tag>();
            foreach (var item in tags)
            {
                Tag t = new Tag();
                t.nom = item;
                _tagManager.SaveIfNot(t);
                allTags.Add(t);
            }
            return allTags;
        }
    }
}
